package com.zengqingfa.examples.mybatisplus.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WarehouseProcess extends Model<WarehouseProcess> {

    private static final long serialVersionUID = 1L;

    /**
     * 逻辑主键
     */
    private Long id;

    /**
     * 仓库id
     */
    private Long warehouseId;

    /**
     * 流程id
     */
    private Long processId;

    /**
     * 仓库类型，1供应商仓，2销司仓
     */
    private Integer warehouseType;

    /**
     * 审批类型,1.仓库创建审批，2.仓库信息变更申请，3撤销仓库申请,4负卖库存甚至申请
     */
    private Integer processType;

    /**
     * 审批状态
     */
    private String approveType;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 修改人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 删除标识:0-未删除;1-已删除
     */
    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    private Integer deleteFlag;

    /**
     * 版本号
     */
    @Version
    private Integer version;

    public static final String ID = "id";

    public static final String WAREHOUSE_ID = "warehouse_id";

    public static final String PROCESS_ID = "process_id";

    public static final String WAREHOUSE_TYPE = "warehouse_type";

    public static final String PROCESS_TYPE = "process_type";

    public static final String APPROVE_TYPE = "approve_type";

    public static final String CREATED_BY = "created_by";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATED_BY = "updated_by";

    public static final String UPDATE_TIME = "update_time";

    public static final String DELETE_FLAG = "delete_flag";

    public static final String VERSION = "version";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
